package com.fatgirl.load.loadStrategy
{
	import com.fatgirl.load.LoadData;
	
	/**
	 * 加载策略基类 
	 * @author iceman
	 * 
	 */
	public class LoadStrategy implements ILoadStrategy
	{
		protected var m_LoadData:LoadData;
		public function LoadStrategy()
		{
		}
		
		public function load(_url:String):void
		{
		}
		
		public function unLoad():void
		{
		}
		public function get loadData():LoadData
		{
			return m_LoadData;
		}
		public function set loadData(_loadData:LoadData):void
		{
			m_LoadData = _loadData;
		}
		protected function complete(_obj:Object):void
		{
			m_LoadData.update("data",_obj);
			m_LoadData.update("loadResultType",LoadData.LOAD_COMPLETE);
		}
		protected function progress(_obj:Object):void
		{
			m_LoadData.update("progress",_obj);
		}
		protected function ioError(_obj:Object):void
		{
			ftrace(this,"ioError:"+_obj);
			m_LoadData.update("data",1);
			m_LoadData.update("loadResultType",LoadData.LOAD_IO_ERROR);
			
			
		}
		protected function open(_obj:Object):void
		{
			m_LoadData.update("url",_obj);
			m_LoadData.update("loadResultType", LoadData.LOAD_OPEN);
			
		}
		protected function security(_obj:Object):void
		{
			m_LoadData.update("url",_obj);
			m_LoadData.update("loadResultType",LoadData.LOAD_SELF_ERROR);
		}
	}
}